Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed function redirect_header() when jGrowl redirect is set #16

Open
wants to merge 1 commit into
base: feature/2512
Choose a base branch
from

Conversation

luciorota
Copy link

Fixed error when $url contains 'user.php' and $addredirect is true

Fixed error when $url contains 'user.php' and $addredirect is true
Copy link

sonarcloud bot commented Jun 15, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@mambax7
Copy link
Owner

mambax7 commented Jun 15, 2024

@luciorota How could we test it?
I'm trying to add tests to the Core, so we can run regression tests with PHPUnit:
https://github.com/mambax7/XoopsCore25/tree/feature/2512/tests/unit

If you could write tests for this fix, that would be awesome!

@luciorota
Copy link
Author

I introduce this fix for this reason:

if 'JGrowl redirect' is set to 'no'/false:

This code redirect_header(XOOPS_URL . "/user.php", $time, $message, true);
will open login page, and after user logins
then redirects to $_SERVER['REQUEST_URI']

if 'JGrowl redirect' is set to 'yes'/true:

This code redirect_header(XOOPS_URL . "/user.php", $time, $message, true);
will open login page, and after user logins
DOESN'T redirects to $_SERVER['REQUEST_URI']

Is it possible to create tests to check this kind of bugs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants